<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/vue.js"></script>
</head>
<body>
<div id="div_id">
    <!--通过v-model实现message和input value双向绑定-->
    <!--<input type="text" v-model="message"/>-->
    <!--也可通过下列方式实现双向绑定-->
    <!--v-on:input :实现监听input输入事件-->
    <input type="text" v-bind:value="message" v-on:input="changeValue">
    <h2>{{message}}</h2>
</div>
<script>
    const app=new Vue({
        el:"#div_id",
        data:{
            message:"12345"
        },
        methods:{
            changeValue:function (event) {
                this.message=event.target.value;
            }
        }
    })
</script>
</body>
</html>